<?php
// No direct access.
if (! defined('INMAIN'))
    exit();
else if (! isset($serviceContent))
{
    @include_once dirname(__DIR__) . '/serviceBoxContent.php';
    if (! isset($serviceContent) || empty($serviceContent))
    {
        echo 'Missing Content / Ελλειπές περιεχόμενο';
        return;
    }
}

$lastRow = count($serviceContent);
$row = 0;

foreach ($serviceContent as $box)
:
    $row ++;

    $boxCount = count($box);
    // Echo Boxes per row.
    ?>
<div class="fp_services <? echo $row === $lastRow ? 'last_box':''; ?>">
  <?php for ($i=0; $i < $boxCount-1; $i++):?>
  <div class="fp_services_box">
    <div class="fp_services_title">
      <a
        class=""
        href="<?php echo $box[$i]['link'];?>"><?php echo $box[$i]['title'];?>
          </a>
    </div>
    <p>
          <?php echo !empty($box[$i]['description']) ? $box[$i]['description'] . ' ...' : ''; ?> <br />
      <a
        class="float_r"
        href="<?php echo !empty($box[$i]['link']) ? $box[$i]['link'] . '">Περισσότερα. . .' : '">'; ?></a>

    </p>
  </div>
  <?php endfor;?>
  <div class="fp_services_box last_box">
    <div class="fp_services_title">
      <a
        class=""
        href="<?php echo $box[$boxCount-1]['link'];?>"><?php echo $box[$boxCount-1]['title']; ?></a>
    </div>
    <p>
      <?php echo !empty($box[$boxCount-1]['description']) ? $box[$boxCount-1]['description'] . ' ...' : ''; ?><br />
      <a
        class="float_r"
        href="<?php echo !empty($box[$boxCount-1]['link']) ? $box[$boxCount-1]['link'] . '">Περισσότερα. . .' : '">'; ?>
        </a>

    </p>
  </div>
</div>
<div class="cleaner"></div>
<?php endforeach;?>
